home *** CD-ROM | disk | FTP | other *** search
/ Aminet 28 / Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso / Aminet / comm / www / UrbCedWWW.lha / urbcedwww / rexx / DelBlock.ucwx < prev    next >
Encoding:
Text File  |  1998-09-30  |  2.2 KB  |  113 lines

  1. /**************************************************************************/
  2. /*                             DelBlock.ucwx                              */
  3. /*                                                                        */
  4. /*                    Copyright ©1998 by Dick Whiting                     */
  5. /*                                                                        */
  6. /*------------------------------------------------------------------------*/
  7. /*                  Deletes all from <TAG> thru </TAG>.                   */
  8. /*      Place cursor in the TAG name portion and invoke the script.       */
  9. /*      See the UrbCedWWW Readme for a more complete description.         */
  10. /**************************************************************************/
  11. /*
  12. $VER: 1.0 Copyright ©1998 by Dick Whiting
  13. */
  14.  
  15. options results
  16. Address CYGNUSED
  17.  
  18. startline=-1
  19. endline=-1
  20. startcol=-1
  21. endcol=-1
  22.  
  23. 'CEDTOFRONT'
  24.  
  25. starttag=1
  26.  
  27. 'GETCHAR'
  28. char=result
  29.  
  30. if char~='<' then do
  31.    'SEARCH FOR' '<' 0 0 0 0 1
  32.    found=result
  33.    if ~found then do
  34.       'OKAY1' 'Not part of a TAG?'
  35.       exit
  36.    end
  37. end
  38.  
  39. 'RIGHT'
  40.  
  41. 'GETCHAR'
  42. char=result
  43.  
  44. if char='/' then do
  45.    starttag=0
  46.    'STATUS CURSORLINE'
  47.    endline=result+1
  48.    'STATUS CURSORCOLUMN'
  49.    endcol=result
  50.    'RIGHT'
  51. end
  52. else do
  53.    'STATUS CURSORLINE'
  54.    startline=result+1
  55.    'STATUS CURSORCOLUMN'
  56.    startcol=result
  57. end
  58. 'GETWORD'
  59. tag=strip(result)
  60.  
  61. if starttag then do
  62.    'SEARCH FOR' '</'tag'>' 1 0 1 0 0 0 0 0 1
  63.    found=result
  64.    if found then do
  65.       'STATUS CURSORLINE'
  66.       endline=result+1
  67.       'STATUS CURSORCOLUMN'
  68.       endcol=result+1
  69.    end
  70. end
  71. else do
  72.    'SEARCH FOR' '<'tag'>' 1 0 0 0 1
  73.    found=result
  74.    if ~found then 'SEARCH FOR' '<'tag' ' 1 0 0 0 1
  75.    found=result
  76.    if found then do
  77.       'STATUS CURSORLINE'
  78.       startline=result+1
  79.       'STATUS CURSORCOLUMN'
  80.       startcol=result+1
  81.    end
  82. end
  83.  
  84. if startline>-1 then do
  85.    'LL' startline startcol
  86.    'MARK'
  87.    on=result
  88.    if ~on then 'MARK'
  89.    'FIND MATCHING BRACKET'
  90.    'RIGHT'
  91.    if endline>-1 then do
  92.       'LL' endline endcol
  93.       'FIND MATCHING BRACKET'
  94.       'RIGHT'
  95.    end
  96.    'CUT'
  97. end
  98. else do
  99.    if endline>-1 then do
  100.       'LL' endline endcol
  101.       'FIND MATCHING BRACKET'
  102.       'RIGHT'
  103.       'MARK'
  104.       on=result
  105.       if ~on then 'MARK'
  106.       'CUT'
  107.    end
  108. end
  109.  
  110. exit
  111.  
  112.  
  113.